<#include "/common/defaultEngine.html"/>
<@pageTheme mark="${config.optimize()?string('true', 'false')}">
<@header title="结束订单列表" bodyClass="gray-bg animated fadeInRight" isAnimation="false" libs=["table","zTree","layout-latest"]/>
<div class="container-div">
 <div class="row">
  <div class="col-sm-12 search-collapse">
    <@form.form id="endorder-form" class="form-inline">
     <div class="select-list">
      <ul>
           <li>
              <label> <@ctx.i18n text = "订单号"/>：
               <input type="text" name="saleCode"/> </label>
            </li>
           <li>
              <label> <@ctx.i18n text = "销售员"/>：
               <input type="text" name="saleUserid"/> </label>
            </li>
           <li>
              <label> <@ctx.i18n text = "车辆识别号"/>：
               <input type="text" name="outCarVin"/> </label>
            </li>
           <li>
              <label> <@ctx.i18n text = "车型"/>：
               <input type="text" name="outCarVehicle"/> </label>
            </li>
           <li>
                 <label> <@ctx.i18n text = "结束类型"/>： </label>
                <select name="orderEndType" class="form-control">
                    <option value=""><@ctx.i18n text = "所有"/></option>
                <#list dict.getType('sys_crm_orderendtype')>
                    <#items as d>
                        <#if d.status =='0' >
                            <option value="${d.dictValue}" text="${d.dictLabel}"><@ctx.i18n text = "${d.dictLabel}"/></option>
                        </#if>
                    </#items>
                </#list>
                </select>
           </li>
           <li>
              <label> <@ctx.i18n text = "实收总和"/>：
               <input type="text" name="creditRealitySum"/> </label>
            </li>
           <li>
              <label> <@ctx.i18n text = "收款单据"/>：
               <input type="text" name="creditBillFilepath"/> </label>
            </li>
           <li>
              <label> <@ctx.i18n text = "类别"/>：
               <input type="text" name="costType"/> </label>
            </li>
           <li>
              <label> <@ctx.i18n text = "金额"/>：
               <input type="text" name="costAmount"/> </label>
            </li>
           <li>
              <label> <@ctx.i18n text = "流程单据"/>：
               <input type="text" name="costAllBusinessFilepath"/> </label>
            </li>
           <li>
              <label> <@ctx.i18n text = "实收总和"/>：
               <input type="text" name="commissionRealitySum"/> </label>
            </li>
           <li>
              <label> <@ctx.i18n text = "目前成本"/>：
               <input type="text" name="commissionCurrentCost"/> </label>
            </li>
           <li>
              <label> <@ctx.i18n text = "最终利润"/>：
               <input type="text" name="commissionFinalProfit"/> </label>
            </li>
           <li>
              <label> <@ctx.i18n text = "最终业绩"/>：
               <input type="text" name="commissionFinalAchievement"/> </label>
            </li>
           <li>
              <label> <@ctx.i18n text = "提成比例"/>：
               <input type="text" name="commissionPercentage"/> </label>
            </li>
           <li>
              <label> <@ctx.i18n text = "最终提成"/>：
               <input type="text" name="commissionFinalCommission"/> </label>
            </li>
           <li>
                 <label> <@ctx.i18n text = "销售总监审核"/>： </label>
                <select name="approvalSalesDirector" class="form-control">
                    <option value=""><@ctx.i18n text = "所有"/></option>
                <#list dict.getType('sys_bpm_crm_passorclose')>
                    <#items as d>
                        <#if d.status =='0' >
                            <option value="${d.dictValue}" text="${d.dictLabel}"><@ctx.i18n text = "${d.dictLabel}"/></option>
                        </#if>
                    </#items>
                </#list>
                </select>
           </li>
           <li>
                 <label> <@ctx.i18n text = "整修评审/复盘/整理评审意见"/>： </label>
                <select name="approvalReconditioning" class="form-control">
                    <option value=""><@ctx.i18n text = "所有"/></option>
                <#list dict.getType('sys_bpm_crm_passorclose')>
                    <#items as d>
                        <#if d.status =='0' >
                            <option value="${d.dictValue}" text="${d.dictLabel}"><@ctx.i18n text = "${d.dictLabel}"/></option>
                        </#if>
                    </#items>
                </#list>
                </select>
           </li>
           <li>
                 <label> <@ctx.i18n text = "维修中心审核"/>： </label>
                <select name="approvalMaintenanceCenter" class="form-control">
                    <option value=""><@ctx.i18n text = "所有"/></option>
                <#list dict.getType('sys_bpm_crm_passorclose')>
                    <#items as d>
                        <#if d.status =='0' >
                            <option value="${d.dictValue}" text="${d.dictLabel}"><@ctx.i18n text = "${d.dictLabel}"/></option>
                        </#if>
                    </#items>
                </#list>
                </select>
           </li>
           <li>
                 <label> <@ctx.i18n text = "运输审核"/>： </label>
                <select name="approvalTransport" class="form-control">
                    <option value=""><@ctx.i18n text = "所有"/></option>
                <#list dict.getType('sys_bpm_crm_passorclose')>
                    <#items as d>
                        <#if d.status =='0' >
                            <option value="${d.dictValue}" text="${d.dictLabel}"><@ctx.i18n text = "${d.dictLabel}"/></option>
                        </#if>
                    </#items>
                </#list>
                </select>
           </li>
           <li>
                 <label> <@ctx.i18n text = "出纳审核"/>： </label>
                <select name="approvalCashier" class="form-control">
                    <option value=""><@ctx.i18n text = "所有"/></option>
                <#list dict.getType('sys_bpm_crm_passorclose')>
                    <#items as d>
                        <#if d.status =='0' >
                            <option value="${d.dictValue}" text="${d.dictLabel}"><@ctx.i18n text = "${d.dictLabel}"/></option>
                        </#if>
                    </#items>
                </#list>
                </select>
           </li>
           <li>
                 <label> <@ctx.i18n text = "盘点"/>： </label>
                <select name="approvalInventory" class="form-control">
                    <option value=""><@ctx.i18n text = "所有"/></option>
                <#list dict.getType('sys_bpm_crm_passorclose')>
                    <#items as d>
                        <#if d.status =='0' >
                            <option value="${d.dictValue}" text="${d.dictLabel}"><@ctx.i18n text = "${d.dictLabel}"/></option>
                        </#if>
                    </#items>
                </#list>
                </select>
           </li>
           <li>
                 <label> <@ctx.i18n text = "税务审核"/>： </label>
                <select name="approvalTax" class="form-control">
                    <option value=""><@ctx.i18n text = "所有"/></option>
                <#list dict.getType('sys_bpm_crm_passorclose')>
                    <#items as d>
                        <#if d.status =='0' >
                            <option value="${d.dictValue}" text="${d.dictLabel}"><@ctx.i18n text = "${d.dictLabel}"/></option>
                        </#if>
                    </#items>
                </#list>
                </select>
           </li>
           <li>
                 <label> <@ctx.i18n text = "会计审核"/>： </label>
                <select name="approvalAccounting" class="form-control">
                    <option value=""><@ctx.i18n text = "所有"/></option>
                <#list dict.getType('sys_bpm_crm_passorclose')>
                    <#items as d>
                        <#if d.status =='0' >
                            <option value="${d.dictValue}" text="${d.dictLabel}"><@ctx.i18n text = "${d.dictLabel}"/></option>
                        </#if>
                    </#items>
                </#list>
                </select>
           </li>
           <li>
                 <label> <@ctx.i18n text = "销售总监审核"/>： </label>
                <select name="approvalSalesDirectorReview" class="form-control">
                    <option value=""><@ctx.i18n text = "所有"/></option>
                <#list dict.getType('sys_bpm_crm_passorclose')>
                    <#items as d>
                        <#if d.status =='0' >
                            <option value="${d.dictValue}" text="${d.dictLabel}"><@ctx.i18n text = "${d.dictLabel}"/></option>
                        </#if>
                    </#items>
                </#list>
                </select>
           </li>
        <li>
          <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;&nbsp;<@ctx.i18n text = "查询"/></a>
          <a class="btn btn-warning btn-rounded btn-sm" onclick="opt.form.reset()"><i class="fa fa-refresh"></i>&nbsp;<@ctx.i18n text = "重置"/></a>
       </li>
      </ul>
   </div>
  </@form.form>
 </div>
  <@table id="bootstrap-table">
    <@shiro.hasPermission name="bpm:endorder:add">
                    <a class="btn btn-success" onclick="opt.operate.add()"><i class="fa fa-plus"></i>&nbsp;<@ctx.i18n text = "新增"/></a>
    </@shiro.hasPermission>
    <@shiro.hasPermission name="bpm:endorder:edit">
        <a class="btn btn-primary single disabled" onclick="opt.operate.edit()"><i class="fa fa-pencil-square-o"></i>&nbsp;<@ctx.i18n text = "修改"/></a>
    </@shiro.hasPermission>
    <@shiro.hasPermission name="bpm:endorder:del">
        <a class="btn btn-danger multiple disabled" onclick="opt.operate.delAll()">
            <i class="fa fa-remove"></i> <@ctx.i18n text = "删除"/>
        </a>
    </@shiro.hasPermission>
   </@table>
  <div>
</div>
<@footer>
<script>
    var editFlag = "${permission.hasPermi("bpm:endorder:edit")}";
    var listFlag = "${permission.hasPermi("bpm:endorder:add")}";
    var delFlag = "${permission.hasPermi("bpm:endorder:del")}";
    var visible = ${permission.isPermitteds("bpm:endorder:edit,bpm:endorder:del,bpm:endorder:add")?string('true', 'false')};
   var orderEndTypeDatas = ${dict.getDictListJson('sys_crm_orderendtype')};
   var approvalSalesDirectorDatas = ${dict.getDictListJson('sys_bpm_crm_passorclose')};
   var approvalReconditioningDatas = ${dict.getDictListJson('sys_bpm_crm_passorclose')};
   var approvalMaintenanceCenterDatas = ${dict.getDictListJson('sys_bpm_crm_passorclose')};
   var approvalTransportDatas = ${dict.getDictListJson('sys_bpm_crm_passorclose')};
   var approvalCashierDatas = ${dict.getDictListJson('sys_bpm_crm_passorclose')};
   var approvalInventoryDatas = ${dict.getDictListJson('sys_bpm_crm_passorclose')};
   var approvalTaxDatas = ${dict.getDictListJson('sys_bpm_crm_passorclose')};
   var approvalAccountingDatas = ${dict.getDictListJson('sys_bpm_crm_passorclose')};
   var approvalSalesDirectorReviewDatas = ${dict.getDictListJson('sys_bpm_crm_passorclose')};
    var prefix = baseURL + "bpm/endorder";

    $(function() {
        var options = {
            url: prefix + "/list",
            addUrl: prefix + "/add",
            editUrl: prefix + "/edit/{id}",
            delUrl: prefix + "/del",
            modalName: "结束订单",
            uniqueId:    'id'/* 唯一ID */                                                                                                   ,
            escape: true,            /* 分页设置 */
            showPageGo: true,       /* 分页设置 */
            pageSize: 10,            /* 分页设置 */
            pageList: [10, 30, 50], /* 分页设置 */
            columns: [
                {title: $.i18n.prop("序号"), width: 5, align: "center", formatter: function (value, row, index) {
                            return $.table.serialNumber(index);
                }}
                ,{field : 'id',title : '<@ctx.i18n text = "主键"/>',visible: false}
               ,{field : 'saleCode',title : '<@ctx.i18n text = "订单号"/>', align: 'center', formatter: function(value, row, index) {return $.table.tooltip(value,10);}}
                     ,{field : 'saleUserid',title : '<@ctx.i18n text = "销售员"/>', align: 'center', formatter: function(value, row, index) {return $.table.tooltip(value,10);}}
              ,{field : 'outCarVin',title : '<@ctx.i18n text = "车辆识别号"/>', align: 'center', formatter: function(value, row, index) {return $.table.tooltip(value,10);}}
              ,{field : 'outCarVehicle',title : '<@ctx.i18n text = "车型"/>', align: 'center', formatter: function(value, row, index) {return $.table.tooltip(value,10);}}
               ,{field : 'orderEndType',title : '<@ctx.i18n text = "结束类型  正常结束/取消订单"/>',formatter: function(value, row, index) { return $.table.selectDictLabels(orderEndTypeDatas, value); }}
               ,{field : 'creditRealitySum',title : '<@ctx.i18n text = "实收总和"/>', align: 'center', formatter: function(value, row, index) {return $.table.tooltip(value,10);}}
              ,{field : 'creditBillFilepath',title : '<@ctx.i18n text = "收款单据"/>', align: 'center', formatter: function(value, row, index) {return $.table.tooltip(value,10);}}
              ,{field : 'costType',title : '<@ctx.i18n text = "类别"/>', align: 'center', formatter: function(value, row, index) {return $.table.tooltip(value,10);}}
              ,{field : 'costAmount',title : '<@ctx.i18n text = "金额"/>', align: 'center', formatter: function(value, row, index) {return $.table.tooltip(value,10);}}
              ,{field : 'costAllBusinessFilepath',title : '<@ctx.i18n text = "流程单据"/>', align: 'center', formatter: function(value, row, index) {return $.table.tooltip(value,10);}}
              ,{field : 'commissionRealitySum',title : '<@ctx.i18n text = "实收总和"/>', align: 'center', formatter: function(value, row, index) {return $.table.tooltip(value,10);}}
              ,{field : 'commissionCurrentCost',title : '<@ctx.i18n text = "目前成本"/>', align: 'center', formatter: function(value, row, index) {return $.table.tooltip(value,10);}}
              ,{field : 'commissionFinalProfit',title : '<@ctx.i18n text = "最终利润"/>', align: 'center', formatter: function(value, row, index) {return $.table.tooltip(value,10);}}
              ,{field : 'commissionFinalAchievement',title : '<@ctx.i18n text = "最终业绩"/>', align: 'center', formatter: function(value, row, index) {return $.table.tooltip(value,10);}}
              ,{field : 'commissionPercentage',title : '<@ctx.i18n text = "提成比例"/>', align: 'center', formatter: function(value, row, index) {return $.table.tooltip(value,10);}}
              ,{field : 'commissionFinalCommission',title : '<@ctx.i18n text = "最终提成"/>', align: 'center', formatter: function(value, row, index) {return $.table.tooltip(value,10);}}
               ,{field : 'approvalSalesDirector',title : '<@ctx.i18n text = "销售总监审核"/>',formatter: function(value, row, index) { return $.table.selectDictLabels(approvalSalesDirectorDatas, value); }}
                ,{field : 'approvalReconditioning',title : '<@ctx.i18n text = "整修评审/复盘/整理评审意见"/>',formatter: function(value, row, index) { return $.table.selectDictLabels(approvalReconditioningDatas, value); }}
                ,{field : 'approvalMaintenanceCenter',title : '<@ctx.i18n text = "维修中心审核"/>',formatter: function(value, row, index) { return $.table.selectDictLabels(approvalMaintenanceCenterDatas, value); }}
                ,{field : 'approvalTransport',title : '<@ctx.i18n text = "运输审核"/>',formatter: function(value, row, index) { return $.table.selectDictLabels(approvalTransportDatas, value); }}
                ,{field : 'approvalCashier',title : '<@ctx.i18n text = "出纳审核"/>',formatter: function(value, row, index) { return $.table.selectDictLabels(approvalCashierDatas, value); }}
                ,{field : 'approvalInventory',title : '<@ctx.i18n text = "盘点"/>',formatter: function(value, row, index) { return $.table.selectDictLabels(approvalInventoryDatas, value); }}
                ,{field : 'approvalTax',title : '<@ctx.i18n text = "税务审核"/>',formatter: function(value, row, index) { return $.table.selectDictLabels(approvalTaxDatas, value); }}
                ,{field : 'approvalAccounting',title : '<@ctx.i18n text = "会计审核"/>',formatter: function(value, row, index) { return $.table.selectDictLabels(approvalAccountingDatas, value); }}
                ,{field : 'approvalSalesDirectorReview',title : '<@ctx.i18n text = "销售总监审核"/>',formatter: function(value, row, index) { return $.table.selectDictLabels(approvalSalesDirectorReviewDatas, value); }}
                ,{title:"<@ctx.i18n text = "操作"/>",align: 'center',visible:visible,formatter: function(value, row, index) {
                        var actions = [];
                          actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="opt.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                        actions.push('<a class="btn btn-danger btn-xs ' + delFlag + '" href="javascript:void(0)" onclick="opt.operate.del(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
                         return actions.join('');
                    }
                }

                ]
            };
            $.table.init(options);
        });

</script>
</@footer>
</@pageTheme>